<template>
    <div id="app">
        <router-view />
    </div>
</template>

<script>
import { ipcApiRoute } from "@/api/main";

export default {
    name: "App",
    components: {},
    data() {
        return {};
    },
    mounted() {
        this.setTheme();
        this.startWebsocket();
    },
    watch: {},
    methods: {
        setTheme() {
            this.$ipcInvoke(ipcApiRoute.setTheme, "light").then((result) => {
                console.log("current theme is:", result);
                // self.currentThemeMode = result;
            });
        },

        /**
         * @desc 启动websocket
         */
        startWebsocket() {
            this.$ipcInvoke(ipcApiRoute.startWebsocket).then((result) => {
                console.log(result);
            });
        },
    },
};
</script>
<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    height: 100%;
}
</style>
